<!DOCTYPE html>
<html lang='en'>

<head>
    <meta charset='UTF-8'>
    <meta http-equiv='X-UA-Compatible' content='IE=edge'>
    <meta name='viewport' content='width=device-width, initial-scale=1.0'>
    <title>Document</title>
    <style>
        #demo {
            width: 100vw;
            height: 100vh;
        }

        .movearea {
            position: absolute;
            top: 0;
            left: 0;
            width: 100vw;
            height: 100vh;
            padding: 6vmin;
            transition: 0.2s background-color ease;
        }
    </style>
    <script src='./vue.global.js'></script>
</head>

<body>
    <div id="demo">
        <div @mousemove="xCoordinate" :style="{ backgroundColor: `hsl(${x}, 80%, 50%)` }" class="movearea">
            <h3>Move your mouse across the screen...</h3>
            <p>x: {{x}}</p>
        </div>
    </div>
    
    <script>
        const Demo = {
            data() {
                return {
                    x: 0
                }
            },
            methods: {
                xCoordinate(e) {
                    this.x = e.clientX;
                }
            }
        }

        Vue.createApp(Demo).mount('#demo')
    </script>
</body>

</html>